package com.hjq.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.hjq.mapper.OperateLogMapper;
import com.hjq.pojo.OperateLog;
import com.hjq.pojo.OperateLogResult;
import com.hjq.pojo.PageResult;
import com.hjq.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LogServiceImpl implements LogService {
    @Autowired
    private OperateLogMapper operateLogMapper;

    @Override
    public PageResult<OperateLogResult> findByPage(Integer page, Integer pageSize) {
        Page<Object> result = PageHelper.startPage(page, pageSize);
        List<OperateLogResult> list = operateLogMapper.findByPage(page, pageSize);
        long total=result.getTotal();
        return new PageResult<>(total,list);
    }
}
